#include "big_int.h"
#include <iostream>
#include <fstream>
#include <vector>
#include <string>

int main()
{
	std::ifstream in("in.txt");
	std::ofstream out("out.txt");
	string s_first, s_second;
	while (in >> s_first >> s_second)
	{
		big_int a, b;
		a = big_int(s_first);
		b = big_int(s_second);
		if (b.zero())
		{
			out << "<error>\n\n";
		}
		else
		{
			pair<big_int,big_int> div_and_rem;
			div_and_rem = a / b;
			out << div_and_rem.first.to_string()<< '\n';
			out << div_and_rem.second.to_string() << '\n';
		}
		out << '\n';
	}
	return 0;
}